From: Chad Horohoe Date: Thu, 6 Jan 2011 18:22:24 +0000 (+0000) Subject: Fix ParserOptions so it uses correct language when transforming messages as reported... X-Git-Tag: 1.31.0-rc.0~32754 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=d297f0b4c604e9497ee573abf9f0468a2a702588;p=lhc%2Fweb%2Fwiklou.git Fix ParserOptions so it uses correct language when transforming messages as reported on translatewiki.net. --- diff --git a/config/index.php b/config/index.php index e394a0428a..95faba8801 100644 --- a/config/index.php +++ b/config/index.php @@ -39,6 +39,8 @@ function wfInstallerMain() { } $wgLang = Language::factory( $langCode ); + $installer->setParserLanguage( $wgLang->getCode() ); + $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT]; $session = $installer->execute( $session ); diff --git a/includes/installer/CoreInstaller.php b/includes/installer/CoreInstaller.php index b8380a3515..e852760fbf 100644 --- a/includes/installer/CoreInstaller.php +++ b/includes/installer/CoreInstaller.php @@ -242,7 +242,7 @@ abstract class CoreInstaller extends Installer { } $this->parserTitle = Title::newFromText( 'Installer' ); - $this->parserOptions = new ParserOptions; + $this->parserOptions = new ParserOptions; // language will be wrong :( $this->parserOptions->setEditSection( false ); } @@ -258,6 +258,14 @@ abstract class CoreInstaller extends Installer { return true; } + /** + * ParserOptions are constructed before we determined the language, so fix it + */ + public function setParserLanguage( $lang ) { + $this->parserOptions->setTargetLanguage( $lang ); + $this->parserOptions->setUserLang( $lang ); + } + /** * Extension tag hook for a documentation link. */